<%@ page language="java" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
    if (path.endsWith("/"))
        path = path.substring(0, path.length() - 1);
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
    request.setAttribute("root",basePath);
%>

<!DOCTYPE HTML>
<html>
  <head>
    <%-- <base href="<%=basePath%>"> --%>

      <title>商户支付测试页面</title>
      <%@include file="import.jsp"%>
      <script type="text/javascript">
          function getTime(){
              var now = new Date();
              var nowTime = ""+now.getFullYear() +pad(now.getMonth()+1,2)+pad(now.getDate(),2)+pad(now.getHours(),2)+pad(now.getMinutes(),2)+pad(now.getSeconds(),2);
               return nowTime;
          }
          /* 质朴长存法  by lifesinger */
          function pad(num, n) {
              var len = num.toString().length;
              while(len < n) {
                  num = "0" + num;
                  len++;
              }
              return num;
          }
      </script>

  </head>
  
  <body>
  <div data-role="page"  data-theme="c">
      <div data-role="header">
          <h1>商户支付测试页面</h1>
      </div>
      <div data-role="content">
          <%-- http://payment-test.jiankangjin.com/jkj_paygate/wx/pay.action --%>
          <form name="testForm" method="post" action="${pageContext.request.contextPath}/wx/pay.action">
              <label>字符集:<input name="inputcharset" type="text" value="1"/></label>
              <label>网关版本:<input name="version" type="text" value="v1.0"/></label>
              <label>语言种类:<input name="language" type="text" value="1"/></label>
              <label>签名类型:<input name="signtype" type="text" value="1"/></label>
              <label>商户编号:<input name="pid" type="text" value="206064184488"/></label>
              <label>医院交易号:<input name="transactionid" type="text" value=""/></label>
              <label>医院订单金额:<input name="orderamount" type="text"value="0.01"/></label>
              <label>医院订单提交时间:<input name="ordertime" type="text"/></label>
              <label>商品明细信息:<input name="productinfo" type="text" value="0D0674387B5CAABC343FF1009B7F52F9500CBB6DEA24A7E6188EB2FEA0871808C17E421B3B03598EB2656F3ED9F656EBF83A0B441D28D57734E0E8E64C7B9D71D4DF21DE0938BE76CC64F9DEEF42768AEE5A91F425C93FB1C82DE9F6447B074CE9E2F4E6751A73CE959ABBC1B5781192378A16D333351306585AC114CCCFE353609C87EF563EE1B530466806CCFF0EF6253C303D3FACB0DD7FB77769D122E293AC39F4569BA903ADB4A45D756E32EB703E178A915825581D39D30974E522017075444AE8E134A4F22974808C9B1D38F0A6953DE1A7D54056A5B1302D769AF1B55E685BA2649AA13F39F72BEB017CFE26A316FE408AC1CF08735A333941B45A3D2509D2B230D7A7E247EC6322EA80C98EAD43BD9E8F6A6B1F60FEB146489348492CE8139D45C9D89665539A2CABCFA762173FA0F5C2A7DCD521149E3604B7CEE80092C3EEF8168B7CD9C1370BC9F92C81F260BB75C00E277FAE16939002879960024390A9966867127FF75604BA04C241179327979BA2AE2A9A030725A672EB7D"/></label>
              <label>渠道类型:<input name="channeltype" type="text" value="WXPUB"/></label>
              <label>渠道用户标识码:<input name="channelid" type="text" value="0013"/></label>
              <label>用户类型:<input name="usertype" type="text" value="WXPUB"/></label>
              <label>用户编号:<input name="userid" type="text"/></label>
              <label>扩展字段1:<input name="ext1" type="text"/></label>
              <label>扩展字段2:<input name="ext2" type="text"/></label>
              <label>后台通知地址:<input name="bgurl" type="text" value="http://payment-test.jiankangjin.com/jkj-paygate/page/keyTest.action"></label>
              <label>前台页面通知地址:<input name="pageurl" type="text" value="http://payment-test.jiankangjin.com/jkj-paygate/page/keyTest.action"></label>
              <label>签名:<input name="signmsg" type="text" value="1111"/></label>
 <input  id="subbut" type="button" value="立即支付" data-corners="false"/>
  </form>
      </div>
  </div>

  <script type="text/javascript">
      $(function(){

          var seqId = getTime() + pad(parseInt(Math.random()*9999),4);
          $("input[name='transactionid']").val(seqId );
          $("input[name='ordertime']").val(getTime());
          $("#subbut").click(function(){
              document.testForm.submit();
          });
      });
  </script>
  </body>
</html>
